package Task6_3;

import java.io.*;

/**
 * @author Administrator
 */
public class CopyFile {


    public static void main(String[] args) throws Exception {
       BufferedInputStream t1 =new BufferedInputStream(new FileInputStream("a.txt"));
       BufferedOutputStream t2=new BufferedOutputStream(new FileOutputStream("C:\\a.txt"));
        byte[] bytes=new byte[1024];
        int len=0;
        while ((len=t1.read(bytes))!=-1){
            t2.write(bytes,0,len);
        }
        t1.close();
        t2.close();


        BufferedInputStream w1=new BufferedInputStream(new FileInputStream("1.mp4"));
        BufferedOutputStream w2=new BufferedOutputStream(new FileOutputStream("C:\\1.mp4"));
        byte[] bytes1=new byte[1024];
        int lens=0;
        while ((lens=w1.read(bytes1))!=-1){
            w2.write(bytes1,0,lens);
        }
        w1.close();
        w2.close();

    }

}
